<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="jquery-1.11.1.min.js"></script>
    <script>
        $(function(){
            $("#onlight").click(function(){
                $("body")[0].style.background = "white";
            })

            $("#offlight").click(function(){
                $("body")[0].style.background = "black";
            })
        })
    </script>
</head>
<body>
  <input type="button" id="onlight" value="开灯">
  <input type="button" id="offlight" value="关灯">
</body>
</html>